#!/usr/bin/python
# coding:utf-8

import json
import requests

"""
取得当前处理基金的实时价格
"""


def get_realtime_price(fundcode):
    url = "http://fundgz.1234567.com.cn/js/%s.js?v=20200321" % fundcode
    r = requests.get(url)
    content_str = r.content
    json_txt = content_str[8:-2]
    dt = json.loads(json_txt)
    return dt["gsz"]
